Xbasic

SQL::TableInfoAddIndex Method

Syntax

L AddIndex(Index as SQL::IndexInfo)

Arguments

Column_Number

The column number of the new index column.

SQL::TableInfo

A SQL::TableInfo object.

Index

SQL::IndexInfo

Description

Add a Index.

Discussion

The AddIndex() method adds a new index definition to a table definition. Names must not duplicate ("" counts as a name).

Example

dim TableInfo as SQL::TableInfo
dim IndexInfo as SQL::IndexInfo
dim IndexColumn as SQL::IndexColumnInfo
TableInfo.Name = "MyTable"
IndexInfo.Name = "Primary_Key"
IndexInfo.PrimaryKey = .t.
IndexColumn.Name = "MyColumnName"
? IndexInfo.AddColumn(IndexColumn)
= .T.
? TableInfo.AddIndex(IndexInfo)
= 1

See Also